import 'package:flutter/material.dart';

class DarawerDemo extends StatelessWidget {
  const DarawerDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: ListView(
        padding: EdgeInsets.zero,
        children: <Widget>[
          const UserAccountsDrawerHeader(
            accountName: Text(
              'User',
              style: TextStyle(fontWeight: FontWeight.bold),
            ),
            accountEmail: Text('Emil'),
            currentAccountPicture: CircleAvatar(
              backgroundImage: NetworkImage(
                  'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F4d40b566-1f0a-4f8d-bc97-c513df8775b3%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1706893461&t=a7c1e75489504ae23c6a5c05a9763c3b'),
            ),
            decoration: BoxDecoration(
              color: Colors.blueAccent,
              image: DecorationImage(
                image: NetworkImage(
                    'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F4d40b566-1f0a-4f8d-bc97-c513df8775b3%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1706893461&t=a7c1e75489504ae23c6a5c05a9763c3b'),
                fit: BoxFit.fill,
                colorFilter: ColorFilter.mode(
                  Color.fromARGB(255, 3, 50, 84),
                  BlendMode.exclusion,
                ),
              ),
            ),
          ),
          // DrawerHeader(
          //     decoration: const BoxDecoration(
          //       color: Colors.grey,
          //     ),
          //     child: Text('Header'.toUpperCase()),
          //   ),
          ListTile(
            title: const Text(
              'messages',
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.message,
              color: Colors.black12,
            ),
            onTap: () => Navigator.pop(context),
          ),
          ListTile(
            title: const Text(
              'favorite',
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.favorite,
              color: Colors.black12,
            ),
            onTap: () => Navigator.pop(context),
          ),
          ListTile(
            title: const Text(
              'settings',
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
            ),
            onTap: () => Navigator.pop(context),
          ),
        ],
      ),
    );
  }
}
